package com.itany.controller;

import com.github.pagehelper.PageInfo;
import com.itany.service.UserService;
import com.itany.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;

/**
 * Author:yaozhiyuan0117@163.com
 * Time:2019/12/20 19:34
 * Describe:
 * version:1.0
 */

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    UserService userService;
    @RequestMapping("/findByPage")
    public Map findByPage(Integer page, Integer rows){
        PageInfo info  =userService.findByPage(page,rows);
        Map map = new HashMap();
        map.put("total", info.getTotal());
        map.put("rows",info.getList());
        return map;
    }

}
